// 清缓存
mui(document).on('tap','.clearCache',function(){
	plus.storage.clear();
	plus.nativeUI.toast('缓存清除成功');
})

// 分享
mui(document).on('tap','.shar',function(){
	let shareObj = null;
	plus.share.getServices(
		function(services){   // 所有分享服务:services,譬如包括:qq/weixin/sinaweibo...
			//获取分享服务成功
			//console.log(services)
			for(let i in services){
				if(services[i].id=='weixin'){
					shareObj = services[i];	// 微信分享对象
				}
			}
			// 如果没有开启分享服务
			if(!shareObj){
				plus.nativeUI.toast('获取分享服务失败');
				return;
			}
			// 分享核心代码(微信分享)
				shareObj.send(
					//朋友圈
					//{content:"hi....",thumbs:['_www/shareLogo.png'], href:'http://hcoder.net',title:'test'},
					//微信好友
					{content:"hi....",thumbs:['../images/wl.png'], href:'http://hcoder.net',title:'test', extra:{scene:'WXSceneSession'}},
					function(){
						plus.nativeUI.alert( "分享成功！" );
					},
					function(e){
						plus.nativeUI.alert( "分享失败："+e.message );
					}
				
				);
		},
		
		function(e){
			//获取分享服务失败
			console.log(e.message);	// 错误信息
		}
	)
})



mui(document).on('tap','.fatherbox .publicjumppage',function(){
	//通过webview show 显示子页面
	// plus.nativeUI.toast('123');
	
	let id = this.getAttribute('data-id')
	// plus.nativeUI.toast(id);
	console.log(id)
	plus.webview.show(id,'slide-in-right',150)
	
})

mui(document).on('tap','.nofatherbox .publicjumppage',function(){
	plus.nativeUI.toast('正在开发中...')
	return
})

mui(".aboutfatherbox").on('tap', '.publicjumppage', function() {
	//获取id
	var urlid = this.getAttribute("id");
	//手机app操作
	mui.plusReady(function() {
		var all = plus.webview.all();
		console.log(JSON.stringify(all))
		//显示预加载页面
		plus.webview.show(urlid, "slide-in-right", 150);
	})
});